﻿using System;
using System.Collections.Generic;

namespace Lr.Core.Web.Mailing
{
    /// <summary>
    /// Defines a "mailer", object that can send out e-mails.
    /// </summary>
    public interface IMailer : IDisposable
    {
        /// <summary>
        /// Sends out an e-mail.
        /// </summary>
        /// <param name="body">The body of the e-mail.</param>
        /// <param name="subject">The subject of the e-mail.</param>
        /// <param name="to">The e-mail address of the reciever.</param>
        /// <param name="cc">The e-mail adresses of the people in cc.</param>
        /// <param name="bcc">The e-mail addresses of the people in bcc.</param>
        /// <returns>Null when mail was sent ok, an <see cref="Exception"/> when something went wrong.</returns>
        Exception Send(string body, string subject, string to, IEnumerable<string> cc = null, IEnumerable<string> bcc = null);

        /// <summary>
        /// Sends out an e-mail.
        /// </summary>
        /// <param name="body">The body of the e-mail.</param>
        /// <param name="subject">The subject of the e-mail.</param>
        /// <param name="to">The e-mail addresses of the recievers.</param>
        /// <param name="cc">The e-mail adresses of the people in cc.</param>
        /// <param name="bcc">The e-mail addresses of the people in bcc.</param>
        /// <returns>Null when mail was sent ok, an <see cref="Exception"/> when something went wrong.</returns>
        Exception Send(string body, string subject, IEnumerable<string> to, IEnumerable<string> cc = null, IEnumerable<string> bcc = null);
    }
}
